﻿@model QBWeb.ViewModels.DetailsViewModels
<style>
    .dl-horizontal dt{width:100px;margin-top:10px;}
    .dl-horizontal dd{margin-left:130px;margin-top:10px;}
</style>
<div id="sing">
    <dl class="dl-horizontal">
        @if (@ViewBag.id_value == 1)
        {
            string correctOption = "";
            <dt style="margin-top:0">
                题干
            </dt>
            <dd>
                @Model.SingleChoiceTb.First().QuestionTb.QuestName;
            </dd>
            foreach (var item in Model.SingleChoiceTb)
            {
                <dt>
                    @Html.DisplayFor(model => item.Options)
                </dt>
                <dd>
                    @Html.DisplayFor(model => item.Value)
                </dd>

                if (item.CorrectOption == 1.ToString())
                {
                    correctOption = item.Options;
                }
            }
            <dt>
                答案
            </dt>
            <dd>
                @correctOption
            </dd>
            <dt>
                答案解析
            </dt>
            <dd>
                @Model.SingleChoiceTb.First().QuestionTb.QuestAnalysis;
            </dd>
        }
        @if (@ViewBag.id_value == 2)
        {
            foreach (var item in Model.TrueFalseTb)
            {
                <dt>
                    @Html.DisplayNameFor(model => item.QuestionTb.QuestName)
                </dt>
                <dd>
                    @Html.DisplayFor(model => item.QuestionTb.QuestName)
                </dd>

                <dt>
                    @Html.DisplayNameFor(model => item.CorrectValue)
                </dt>
                <dd>
                    @Html.DisplayFor(model => item.CorrectValue)
                </dd>

                <dt>
                    @Html.DisplayNameFor(model => item.QuestionTb.QuestAnalysis)
                </dt>
                <dd>
                    @Html.DisplayFor(model => item.QuestionTb.QuestAnalysis)
                </dd>
            }
        }
        @if (@ViewBag.id_value == 3)
        {
            foreach (var item in Model.BlanksTb)
            {
                <dt style="margin-top:0">
                    题干
                </dt>
                <dd>
                    @Html.DisplayFor(model => item.QuestionTb.QuestName)
                </dd>

                <dt>
                    答案
                </dt>
                <dd>
                    @Html.DisplayFor(model => item.CorrectValue)
                </dd>

                <dt>
                    答案解析
                </dt>
                <dd>
                    @Html.DisplayFor(model => item.QuestionTb.QuestAnalysis)
                </dd>
            }
        }

    </dl>
</div>
